package com.woniuxy.system.controller;

import com.woniuxy.system.common.Result;
import com.woniuxy.system.model.vo.PageVo;
import com.woniuxy.system.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 作者
 * @since 2023-10-13
 */
@RestController
@RequestMapping("/role")
public class RoleController {
    @Autowired
    private IRoleService roleService;

    @GetMapping("/findAll")
    public Result findAll(
            @RequestParam(defaultValue = "1") Integer pageNum,
            @RequestParam(defaultValue = "5") Integer pageSize, String name) {
        PageVo pageVo = roleService.findAll(pageNum,pageSize,name);
        return Result.ok(pageVo);
    }
}
